package com.xs.project.service.impl;

import com.xs.project.common.Result;
import com.xs.project.mapper.UserCourseDeviceMapper;
import com.xs.project.pojo.vo.StudentDeviceRequest;
import com.xs.project.pojo.vo.resp.StudentCourseDeviceResp;
import com.xs.project.service.UserCourseDeviceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class UserCourseDeviceServiceImpl implements UserCourseDeviceService {
    @Resource
    private UserCourseDeviceMapper userCourseDeviceMapper;
    @Override
    public Result<Boolean> insertDeviceList(StudentCourseDeviceResp request) {
        userCourseDeviceMapper.insertDeviceList(request);
        return Result.success(true);
    }

    @Override
    public Result<Boolean> updateDeviceList(StudentCourseDeviceResp request) {
        userCourseDeviceMapper.updateDeviceList(request);
        return Result.success(true);
    }

    @Override
    public Result<List<StudentCourseDeviceResp>> selectStudentDevices(StudentDeviceRequest studentDeviceRequest) {
        return  Result.success(userCourseDeviceMapper.selectStudentDevices(studentDeviceRequest));
    }
}
